package com.financing.platform.dao.impl;


import com.financing.platform.dao.IFpOrderCostDao;
import com.financing.platform.dto.FpOrderCostDTO;
import com.financing.platform.util.SqlName;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.List;

/**
 * fp_order_cost  
 * 订单费用表(打款结佣) 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpOrderCostDao")
public class FpOrderCostDaoImpl extends BaseDaoImpl implements IFpOrderCostDao {


	@Override
	public String insert(FpOrderCostDTO fpOrderCost) throws SQLException {
		return (String) this.sqlMapClient.insert(SqlName.FpOrderCostSql.insert, fpOrderCost);
	}

	@Override
	public void update(FpOrderCostDTO fpOrderCost) throws SQLException {
		this.sqlMapClient.update(SqlName.FpOrderCostSql.update, fpOrderCost);
	}

	@Override
	public void updateForce(FpOrderCostDTO fpOrderCost) throws SQLException {
		this.sqlMapClient.update(SqlName.FpOrderCostSql.updateForce, fpOrderCost);
	}

	@Override
	public void delete(String id) throws SQLException {
		this.sqlMapClient.delete(SqlName.FpOrderCostSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<FpOrderCostDTO> queryList(FpOrderCostDTO fpOrderCost) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FpOrderCostSql.queryList, fpOrderCost);
	}

	@Override
	public int queryListCount(FpOrderCostDTO fpOrderCost) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpOrderCostSql.queryListCount, fpOrderCost);
	}

	@Override
	public FpOrderCostDTO loadById(String id) throws SQLException {
		return  (FpOrderCostDTO)this.sqlMapClient.queryForObject(SqlName.FpOrderCostSql.loadById,id);
	}
 	
}
